.. highlightlang:: us .. index:: @f{xyvalue} .. _@f{xyvalue}: @f{xyvalue} =========== .. us.tag @f{xyvalue} NOTREADYENGLISH fieldfunction Displays the x- and y-coordinate of a given 1D or 2D dataset. .. function:: @f{xyvalue(datasetname, type, index)} @f{xyvalue(datasetname, type, index, format)} .. us.params **Parameters** .. uparam:: datasetname Is the name of a 1D or 2D dataset. To access a dataset on a different page, the page name can be added to the dataset name, separated by a colon (:), for example ``Data1:Page2``. .. uparam:: type Is the type of the coordinate: .. list-table:: :header-rows: 1 * - Value - Meaning * - x - x coordinate * - y - y coordinate * - x_pos - x coordinate: Text object will be moved to this position. * - y_pos - y coordinate: Text object will be moved to this position. * - ymax - Find the maximum value. *index* will be ignored. Text object will be moved to this position. If you want to set the position manually use :ref:`@f{xystatvalue}`. * - ymin - Find the mainimum value. *index* will be ignored. Text object will be moved to this position. If you want to set the position manually use :ref:`@f{xystatvalue}`. * - ydiff - Calculates the difference between the last and the first data point. *index* will be ignored. * - ydiffminmax - Calculates the difference between the maximum and minimum value. *index* will be ignored. * - name - Displays the channel name. Can be added to the value name separated by a period (.), i.e. ``@f{xyvalue(Data6, ymax.name.unit)}`` * - unit - Displays the unit name, e. g. ``@f{xyvalue(Data6, unit)}`` * - enumvalue - Displays the enum value of the channel at the x or y position, e. g. ``@f{xyvalue(Data1,ymax.enumvalue, 1,%g)}`` If the string ``:date`` is added to the type name the value will be formatted as a date/time value. .. uparam:: index Data point index. The Index starts with 1. If a negative index is specified, the counting starts at the last data point. Example: To read the value of the second last point index is -2. .. uparam:: format Specifies the number format. The default format is %g. Example: %.3lf will print the values with 3 decimal places. For a complete description see :ref:`printf`. In field functions commas are not allowed inside the format string. If the string ``:date`` is added to the type name the value will be formatted as a date/time value. To format the string the :ref:`DT_Format` function is used. .. us.example **Example** ``y[1]: @f{xyvalue(Data 1, y, 1)}`` ``y[last]: @f{xyvalue(Data 1, y, -1, %.2lf)}`` ``Date: @f{xyvalue(Data2, x:date, 1, %c)}`` ``@f{xyvalue(Data 1, y.name.unit, 1)}`` **Output**: ``y[1]: 123.2`` ``y[last]:= 123.19`` ``Date: 1.11.2007 00:00:00`` ``speed: 1000 1/min`` .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2021.2 - Correction of ymax.enumvalue output. .. seealso:: :ref:`overview-field-functions`, :ref:`editupdate-fields`, :ref:`diagraminsert-field-function`, :ref:`DT_Format`, :ref:`printf`, :ref:`@f{xystatvalue}` :sub:`id-1829138`